package Year22_Month03.day14;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int sum = sc.nextInt();
            if(sum < 2){
                System.out.println(0);
            }else {
                int count = 0;//记录喝了多少汽水
                while (sum > 2) {
                    int a = sum / 3;//记录目前可以喝多少瓶汽水
                    sum %= 3; //更新数据，记录喝了之后还剩多少汽水
                    count += a;//喝了多少汽水
                    sum += a;//喝完之后空瓶子还可以用
                }
                if (sum == 2) {
                    count++;
                }
                System.out.println(count);
            }
        }
    }
}
